import datetime
import time
from pathlib import Path

from torch.utils.tensorboard import SummaryWriter

from utils.logging_utils import get_logger

logger = get_logger()

def get_summary_writer(log_dir):
    writer = SummaryWriter(log_dir)
    return writer

def get_encoder_decoder_conv_lstm_summary_writer_path():
    path = Path(__file__).parent.parent / f"logs/encoder-decoder-conv-lstm-summary/summary/{datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d_%H-%M-%S')}/"
    Path(path).mkdir(parents=True, exist_ok=True)
    logger.info(f'encoder-decoder-conv-lstm-summary path : {path}')
    return path